<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>

<meta HTTP-EQUIV="pragma" CONTENT="no-cache">
<meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<meta HTTP-EQUIV="expires" CONTENT="0">
<%
response.setHeader("Cache-Control","no-store");
response.setHeader("Pragrma","no-cache");
response.setDateHeader("Expires",0);
%>

	<title>_异常单管理</title>
	<script type="text/javascript">
	
	   //入库订单数组
	   var exceptionIdArray=new Array();
	   var filterParam = {};
		var datatable_content;
		function initTable(){
			datatable_content = $("#contentTable").dataTable({
			   "bServerSide":true,
			   "bAutoWidth":false,
			   "sScrollX": "100%",
			   "sScrollXInner": "100%",
			   "bScrollInfinite": true,
			   "bScrollCollapse": true,
	           "sAjaxSource":'${ctx}/v2/backOrder/page',
	           "fnServerData": callback,
	           "fnRowCallback":rowCallBack,
	           "bFilter": false,
	           "bSort": false,
	           "sZeroRecords": "查询无记录！",
	           "bProcessing": true,
	           "oLanguage": {
	               "sUrl": '${ctx}/static/v2/js/plugins/datatables/cn.txt'
	            },
	             "aoColumns":[
	             	 {"mData": null},
	             	 {"mData": null},
	             	 {"mData": null},
	             	 {"mData": null},
	             	 {"mData": null},
	             	 {"mData": "expressNo"},
	             	 {"mData": "order.order.shopna",
			          "sDefaultContent":""},
	             	 {"mData": "fromOrderno"},
	             	 {"mData": null},
	             	 {"mData": null},
	             	 {"mData": null},
	             	 {"mData": null},
	             	 {"mData": null},
	             	 {"mData": null},
	             ],
	             "aoColumnDefs":[
	                {"aTargets": [0],
		              "mRender": function (data, display, row) {
		              		if(row.backStatus == "qc"){
		              			return "<input type=\"checkbox\" id=\"chk_"+row.id+"\" name=\"chk_myChecked\" value=\""+row.id+"\" onclick=\"myChecked('"+row.id+"')\"/>"+
								        "<input type=\"hidden\" id=\"warehouseCode_"+row.id+"\" value=\""+row.warehouseCode+"\" />"+
									    "<input type=\"hidden\" id=\"customerCode_"+row.id+"\" value=\""+row.customerCode+"\" />";
		              		}else{
		              			return "";
		              		}
			           }
		            },
	                {"aTargets": [2],
		              "mRender": function (data, display, row) {
		              		<c:forEach items="${customerList}" var="customer">
								if("${customer.customerCode}" == row.customerCode){
									return "${customer.customerName}";
								}
							</c:forEach>
							return "";
			           }
		            },
	                {"aTargets": [3],
		              "mRender": function (data, display, row) {
		              		return row.warehouse ? row.warehouse.groupName : "";
			           }
		            },
	                {"aTargets": [4],
		              "mRender": function (data, display, row) {
							return "<a href=\"${ctx}/orderMsg/v2_orderMsgDetail/"+row.orderno+"\" title=\"查看订单信息\">"+row.orderno+"</a>";
			           }
		            },
	                {"aTargets": [8],
		              "mRender": function (data, display, row) {
							return row.creater ? row.creater.realname : "";
			           }
		            },
	                {"aTargets": [9],
		              "mRender": function (data, display, row) {
							return row.createTime ? new Date(row.createTime.time).Format("yyyy-MM-dd") : "";
			           }
		            },
	                {"aTargets": [10],
		              "mRender": function (data, display, row) {
		              		return row.exceptionType == "cancel" ? "<font color=red>取消单</font>" :
							row.exceptionType == "refuse" ? "<font color=green>拒收单</font>":
							row.exceptionType == "change" ? "<font color=blue>换货单</font>":
							row.exceptionType == "outScope" ? "<font color=purple>超区单</font>":
							row.exceptionType == "lose" ? "<font color=black>丢件单</font>":"" ;
			           }
		            },
	                {"aTargets": [11],
		              "mRender": function (data, display, row) {
		              		return row.recallFlag == "recall" ? "已重发 " : 
							row.recallFlag == "unrecall" ?
						        ("<button id=\"btn_"+row.orderno+"\"  class=\"btn btn-info\" onclick=\"toRecall('"+row.id+"');\">重发</button>" ): "";
			           }
		            },
	                {"aTargets": [12],
		              "mRender": function (data, display, row) {
							if (!row.backStatus && row.exceptionType == 'cancel'){
					             return "<button  class=\"btn btn-default\" id=\"btn_receive_"+row.id+"\" onclick=\"receive('"+row.id+"');\" disabled=\"disabled\">未收货</button>"+
					             "<button  class=\"btn btn-default\"          id=\"btn_qc_"+row.id+"\"      onclick=\"qc('"+row.id+"');\"      disabled=\"disabled\">未质检</button>"+
					             "<button  class=\"btn btn-default\"          id=\"btn_backin_"+row.id+"\"      onclick=\"backin('"+row.id+"');\"     disabled=\"disabled\">未入库</button>";
					        }else if(row.backStatus == 'wait'){
					             return "<button  class=\"btn btn-info\" id=\"btn_receive_"+row.id+"\" onclick=\"receive('"+row.id+"');\" >待收货</button>"+
					             "<button  class=\"btn btn-default\"          id=\"btn_qc_"+row.id+"\"      onclick=\"qc('"+row.id+"');\"       disabled=\"disabled\">未质检</button>"+
					             "<button  class=\"btn btn-default\"          id=\"btn_backin_"+row.id+"\"      onclick=\"backin('"+row.id+"');\"      disabled=\"disabled\">未入库</button>";
					        }else if(row.backStatus == 'receive'){
					            return "<button  class=\"btn btn-default\"           id=\"btn_receive_"+row.id+"\" onclick=\"receive('"+row.id+"');\" disabled=\"disabled\">已收货</button>"+
					             "<button  class=\"btn btn-info\"  id=\"btn_qc_"+row.id+"\"      onclick=\"qc('"+row.id+"');\" >待质检</button>"+
					             "<button  class=\"btn btn-default\"           id=\"btn_backin_"+row.id+"\"      onclick=\"backin('"+row.id+"');\"      disabled=\"disabled\">未入库</button>";
					        }else if(row.backStatus == 'qc'){
					        	return "<button  class=\"btn btn-default\"          id=\"btn_receive_"+row.id+"\" onclick=\"receive('"+row.id+"');\" disabled=\"disabled\">已收货</button>"+
					             "<button  class=\"btn btn-default\"          id=\"btn_qc_"+row.id+"\"      onclick=\"qc('"+row.id+"');\"       disabled=\"disabled\">已质检</button>"+
					             "<button  class=\"btn btn-info\" id=\"btn_backin_"+row.id+"\"      onclick=\"backin('"+row.id+"');\"  >待入库</button>";
					        }else if(row.backStatus == 'in'){
					            return  "<button  class=\"btn btn-default\" id=\"btn_receive_"+row.id+"\"  onclick=\"receive('"+row.id+"');\" disabled=\"disabled\">已收货</button>"+
					             "<button  class=\"btn btn-default\" id=\"btn_qc_"+row.id+"\"       onclick=\"qc('"+row.id+"');\"       disabled=\"disabled\">已质检</button>"+
					             "<button  class=\"btn btn-default\" id=\"btn_backin_"+row.id+"\"       onclick=\"backin('"+row.id+"');\"      disabled=\"disabled\">已入库</button>";
					        }else{
					        	return "";
					        }
			           }
		            },
	                {"aTargets": [13],
		              "mRender": function (data, display, row) {
							if(row.order){ 
								if(row.order.status != '1' ){
							        if(row.order.status == '0' || row.order.status == '2'){
							        	return "<font color=green>拦截成功</font>";
							        }else{
							            return row.cancelStatus == "stop" ? "<font color=green>拦截成功</font>":
							               row.cancelStatus == "pass" ? "<font color=red>拦截失败</font> " : 
							               row.cancelStatus == "regist" ?
									        "<button id=\"btn_stop_"+row.orderno+"\"  class=\"btn btn-success\" onclick=\"cancelFlag('"+row.orderno+"','stop','"+row.id+"');\">已拦截</button>"+
									        "<button id=\"btn_pass_"+row.orderno+"\"  class=\"btn btn-danger\" onclick=\"cancelFlag('"+row.orderno+"','pass','"+row.id+"');\">未拦截</button>"
									        : "";
							        }
						        }
						  }
						  return "";
			           }
		            },
	             ]
			});
		}
		function filter(item){
			filterParam[item.name] = item;
		}
		function callback(sSource, aoData, fnCallback ) {
		   	var formParam = $("#queryForm").serializeArray();
			for(var n in filterParam){
				formParam.push(filterParam[n]);
			}
		   $.ajax({ 
		       "type": "post",
		       "contentType": "application/json", 
		       "url": sSource,    
		       "dataType": "json",   
		       "data": JSON.stringify(aoData.concat(formParam)),
		       "success": fnCallback  
		   });
		}
		
		/**
		*创建了行的回调
		*nRow为当前的tr
		*/
		function rowCallBack(nRow, aData, iDisplayIndex, iDisplayIndexFull){
			var iDisplayStart = datatable_content.fnSettings()._iDisplayStart;
			$("td:eq(0)", nRow).iCheck({checkboxClass: 'icheckbox_minimal'});
			$("td:eq(1)", nRow).html(iDisplayStart+iDisplayIndex+1);
			$("td:eq(10)", nRow).attr("id","status_"+aData.orderno);
			$("td:eq(12)", nRow).attr("id","cancelStatus_"+aData.orderno);
		}
		
		function load(){
			if($("#queryForm").valid()){
				if (datatable_content) {
					datatable_content.fnDestroy();
				}
				initTable();
			}
		} 
       $(function() {
		    $("#queryForm").validate(); 
			$("#_fromDate").datepicker({ 
               language : "zh-CN",
			   format : 'yyyy-mm-dd' });
			$("#_toDate").datepicker({ 
			  language : "zh-CN",
			  format : 'yyyy-mm-dd' });
			initTable();
			$("#chk_myCheckedAll").on("ifChanged", function(event){
				myCheckedAll();
			});
       });
	  
		//取消单重发
		function recall(orderno){
		
		    var btn=$("#btn_"+orderno);
		    btn.attr("disabled", true);
		    
		    $.ajax({
			type:'post',
			url:'${ctx}/cancelOrder/ajaxRecall',
			data:{
				orderno:orderno
			},
			dataType:'json',
			success:function(data) {
			    var msg=data.msg;
			    
			    if(msg=='success'){
			       alert("重发操作成功。");
			       btn.remove();
			       $("#status_"+orderno).html("<font color=blue>已重发</font>");
			    }else if(msg=='noExist'){
			       alert("不存在此单号");
			       btn.attr("disabled", false);
			    }else if(msg=='noCancelStatus'){
			       alert("不在取消状态，不能重发");
			       btn.attr("disabled", false);
			    }else{
			       alert("网络繁忙，请稍后重试...");
			       btn.attr("disabled", false);
			    }
			    
			},
			error:function() {
				alert("网络繁忙，请稍后重试...");
				btn.attr("disabled", false);
			}
	   });
	   
	}
	
	//导向重发页面
	function toRecall(exceptionOrderId){
	   window.location.href = "${ctx}/v2/backOrder/toRecallPage/"+exceptionOrderId;
	}
	
	//设置按钮状态
	function setButton(id,status){
	   var btn_wait=$("#btn_wait_"+id);
	   var btn_receive=$("#btn_receive_"+id);
	   var btn_qc=$("#btn_qc_"+id);
	   var btn_backin=$("#btn_backin_"+id);
	   
	   if(status=='wait'){
	      btn_receive.attr("disabled",false); btn_receive.attr("class","btn btn-info"); btn_receive.text("待收货");
	      btn_qc.attr("disabled",true); btn_qc.attr("class","btn");                     btn_qc.text("未质检");
	      btn_backin.attr("disabled",true); btn_backin.attr("class","btn");                     btn_backin.text("未入库");
	   }
	   else if(status=='receive'){
	      btn_receive.attr("disabled",true); btn_receive.attr("class","btn btn-green"); btn_receive.text("已收货");
	      btn_qc.attr("disabled",false); btn_qc.attr("class","btn btn-info"); btn_qc.text("待质检");
	      btn_backin.attr("disabled",true); btn_backin.attr("class","btn");           btn_backin.text("未入库");
	   }
	   else if(status=='qc'){
	      btn_receive.attr("disabled",true); btn_receive.attr("class","btn"); btn_receive.text("已收货");
	      btn_qc.attr("disabled",true); btn_qc.attr("class","btn");           btn_qc.text("已质检");
	      btn_backin.attr("disabled",false); btn_backin.attr("class","btn-info");     btn_backin.text("待入库");
	   }
	    else if(status=='in'){
	      btn_receive.attr("disabled",true); btn_receive.attr("class","btn"); btn_receive.text("已收货");
	      btn_qc.attr("disabled",true); btn_qc.attr("class","btn");           btn_qc.text("已质检");
	      btn_backin.attr("disabled",true); btn_backin.attr("class","btn");           btn_backin.text("已入库");
	   }
	}
	
	
	//收货
	function receive(exceptionOrderId){
	    var btn=$("#btn_receive_"+exceptionOrderId);
	    btn.attr("disabled", true);
	    
	     $.ajax({
			type:'post',
			url:'${ctx}/v2/backOrder/ajaxReceive',
			data:{
				exceptionOrderId:exceptionOrderId
			},
			dataType:'json',
			success:function(data) {
			    var msg=data.msg;
			    
			    if(msg=='success'){
			       alert("收货成功。");
			       setButton(exceptionOrderId,'receive');
			    }
			    else if(msg=='nostatus'){
			       alert("不在收货状态，请刷新查看。");
			       btn.attr("disabled", false);
			    }
			    else{
			       alert("网络繁忙，请稍后重试...");
			       btn.attr("disabled", false);
			    }
			    
			},
			error:function() {
				alert("网络繁忙，请稍后重试...");
				btn.attr("disabled", false);
			}
	   });
	}
	
	//质检
	function qc(exceptionOrderId){
	   window.location.href = "${ctx}/v2/backOrder/toQcPage/"+exceptionOrderId;
	}
	
	
	//单件创建入库单
	function backin(exceptionId){
	
      var btn=$("#btn_backin_"+exceptionId);
      btn.attr("disabled", true);
      btn.attr("class", "btn");
	    
      exceptionIdArray.length=0;
      var customerCode=$("#customerCode_"+exceptionId).val();
      var warehouseCode=$("#warehouseCode_"+exceptionId).val();
      
      exceptionIdArray.push(exceptionId);
      
      var jsonList = eval(exceptionIdArray); 
	  var jsonText = JSON.stringify(jsonList);
      
      //创建入库单
      $.ajax({
			type:'post',
			url:'${ctx}/v2/backOrder/ajaxCreateInBill',
			data:{
				customerCode:customerCode,
				warehouseCode:warehouseCode,
				exceptionIdArray:jsonText
			},
			dataType:'json',
			success:function(data) {
			    var msg=data.msg;
			    
			    if(msg=='success'){
			       alert("创建入库单成功，请做上架作业...");
			       
			       btn.attr("disabled", true);
	               btn.attr("class", "btn");
	               btn.text("已入库");
	               $("#chk_"+exceptionId).remove();
			    }
			    else if(msg=='nostatus'){
			       alert("你选择的订单，不在入库状态，请刷新页面后重试...");
			       btn.attr("disabled", false);
	               btn.attr("class", "btn btn-info");
			    }
			    else{
			       alert("网络繁忙，请稍后重试...");
			       btn.attr("disabled", false);
	               btn.attr("class", "btn btn-info");
			    }
			    
			   
			    
			},
			error:function() {
				alert("网络繁忙，请稍后重试...");
				btn.attr("disabled", false);
	            btn.attr("class", "btn btn-info");
			}
	   }); 

	}
	
	//全选事件
    function myCheckedAll(){
	   //$("input[name='chk_myChecked']").attr("checked",$("#chk_myCheckedAll").is(":checked"));
	   $("input[name='chk_myChecked']").iCheck($("#chk_myCheckedAll").is(":checked") ? "check" : "uncheck");
    }
    
    //单选事件	
    function myChecked(id) {
	   if ($("#chk_myChecked_" + id).is(":checked")) {
	   } else {
		 $("#chk_myCheckedAll").attr("checked", false);
	   }
    }
    
    //批量创建入库单
  	function createInBill(){
  	  
  	  var btn=$("#btn_createBill");
	  btn.attr("disabled", true);
	  btn.attr("class", "btn");
  	  
      exceptionIdArray.length=0;
      
      var checkArray=$("input[name='chk_myChecked']:checked");
      if(checkArray.length==0){
         alert("请选择待入库单！");
         
         btn.attr("disabled", false);
	     btn.attr("class", "btn btn-warning");
         return;
      }
      
      var customerCode="temp";
      var warehouseCode="temp";
      var flag="1";
      
      checkArray.each(function(){
         var exceptionId=$(this).val();
         var _customerCode=$("#customerCode_"+exceptionId).val();
         var _warehouseCode=$("#warehouseCode_"+exceptionId).val();
         
         if(customerCode=='temp'){
             customerCode=_customerCode;
             warehouseCode=_warehouseCode;
         }else{
             if(_customerCode!=customerCode){
                   alert("请选择相同商家的订单。");
                   flag="0";
                   return false;   
             }
             if(_warehouseCode!=warehouseCode){
                   alert("请选择相同作业仓库的订单。");
                   flag="0";
                   return false;  
             }
         }
         exceptionIdArray.push(exceptionId);
      });
      
      if(flag=="0"){
         btn.attr("disabled", false);
	     btn.attr("class", "btn btn-warning");
         return false;
      }
      
      var jsonList = eval(exceptionIdArray); 
	  var jsonText = JSON.stringify(jsonList);
      
      //创建入库单
      $.ajax({
			type:'post',
			url:'${ctx}/v2/backOrder/ajaxCreateInBill',
			data:{
				customerCode:customerCode,
				warehouseCode:warehouseCode,
				exceptionIdArray:jsonText
			},
			dataType:'json',
			success:function(data) {
			    var msg=data.msg;
			    
			    if(msg=='success'){
			       alert("创建入库单成功，请做上架作业...");
			       load(); 
			    }
			    else if(msg=='nostatus'){
			       alert("你选择的订单，不在入库状态，请刷新页面后重试...");
			       btn.attr("disabled", false);
	               btn.attr("class", "btn btn-warning");
			    }
			    else{
			       alert("网络繁忙，请稍后重试...");
			       btn.attr("disabled", false);
	               btn.attr("class", "btn btn-warning");
			    }
			    
			    
			    
			},
			error:function() {
				alert("网络繁忙，请稍后重试...");
				btn.attr("disabled", false);
	            btn.attr("class", "btn btn-warning");
			}
	   });
  } 
  
  
    //取消单重发
	function recall(orderno){
		
		    var btn=$("#btn_"+orderno);
		    btn.attr("disabled", true);
		    
		    $.ajax({
			type:'post',
			url:'${ctx}/cancelOrder/ajaxRecall',
			data:{
				orderno:orderno
			},
			dataType:'json',
			success:function(data) {
			    var msg=data.msg;
			    
			    if(msg=='success'){
			       alert("重发操作成功。");
			       btn.remove();
			       $("#status_"+orderno).html("已重发");
			    }else if(msg=='noExist'){
			       alert("不存在此单号");
			       btn.attr("disabled", false);
			    }else if(msg=='recalled'){
			       alert("已重发，不能重复重发！");
			       btn.attr("disabled", false);
			    }else{
			       alert("网络繁忙，请稍后重试...");
			       btn.attr("disabled", false);
			    }
			    
			},
			error:function() {
				alert("网络繁忙，请稍后重试...");
				btn.attr("disabled", false);
			}
	   });
	}
	
	//拦截标识
	function cancelFlag(orderno,flag,exceptionOrderId){
		var btn_pass=$("#btn_pass_"+orderno);
		var btn_stop=$("#btn_stop_"+orderno);
		btn_pass.attr("disabled", true);
		btn_stop.attr("disabled", true);
		
	    $.ajax({
			type:'post',
			url:'${ctx}/cancelOrder/ajaxCancelFlag',
			data:{
				orderno:orderno,
				flag:flag
			},
			dataType:'json',
			success:function(data) {
			
			    var msg=data.msg;
			    
			    if(msg=='success'){
			       alert("标识成功!");
			       
			       btn_pass.remove();
			       btn_stop.remove();
			       
			       if(flag=='stop'){
			          $("#cancelStatus_"+orderno).html("<font color=green>拦截成功</font>");
			          setButton(exceptionOrderId,'receive');
			       }else if(flag=='pass'){
			          $("#cancelStatus_"+orderno).html("<font color=red>拦截失败</font>");
			          setButton(exceptionOrderId,'wait');
			       }
			       
			    }else if(msg=='error'){
			       alert("标识失败");
			       btn_pass.attr("disabled", false);
			       btn_stop.attr("disabled", false);
			    }else if(msg=='exceptionError'){
				   jAlert(data.content,"错误提示");
				   btn_pass.attr("disabled", false);
				   btn_stop.attr("disabled", false);
			    }else{
			       alert("网络繁忙，请稍后重试...");
			       btn_pass.attr("disabled", false);
			       btn_stop.attr("disabled", false);
			    }
			    
			},
			error:function() {
				alert("网络繁忙，请稍后重试...");
				btn.attr("disabled", false);
			}
	   });
	}
	
	function cancelExcel(){
			var fromDate = $("#_fromDate").val();
			var toDate = $("#_toDate").val();
			var warehouseCode = $("#_warehouseCode").val();
			if(fromDate=="" || toDate==""){
				alert("时间不能空！");
				return;
			}
			if(warehouseCode==""){
				alert("作业仓库不能为空！");
				return;
			}
			$("#queryForm").attr("action","${ctx}/v2/backOrder/outCancelExcel");
	        $("#queryForm").submit();
      }  
    </script>
</head>

<body>
<section class="content">
	<div class="row">
		<div class="col-md-12">
			<!-- Primary box -->
			<div class="box box-solid box-primary">
				<div class="box-header">
					<i class="fa fa-search"></i>
					<h3 class="box-title">搜索栏</h3>
					<div class="box-tools pull-right">
						<button class="btn btn-primary btn-sm" data-widget="collapse">
							<i class="fa fa-minus"></i>
						</button>
					</div>
				</div>
				<div class="box-body">	
	<form class="form-search" id="queryForm" method="post">
						<div class="form-group row">
							<div class="col-sm-3">
								<div class="input-textgroup col-sm-12">
									<span class="input-group-text"> 商家名称： </span>
									  <select  name="_customerCode"  class="form-control" id="_customerCode" value="${param._customerCode}"  class="input-medium" onchange="ajaxAreaGroup(this,'_warehouseCode');">
					<option value=""></option>
					<c:forEach items="${customerList}" var="customer">
						<option value="${customer.customerCode}"
						<c:if test="${param._customerCode eq customer.customerCode}">selected=selected</c:if>
						>${customer.customerName}</option>
					</c:forEach>
				</select>
								</div>
							</div>
                            <div class="col-sm-3">
								<div class="input-textgroup col-sm-12">
									<span class="input-group-text"> 作业仓库： </span> 
									 <select  name="_warehouseCode" class="form-control" id="_warehouseCode" value="${param._warehouseCode}"  class="input-medium">
					<option value=""></option>
					<c:forEach items="${warehouseList}" var="w" >
					   <option value="${w.groupCode}" 
					   <c:if test="${param._warehouseCode eq w.groupCode }">selected=selected</c:if>
					   >${w.groupName}</option>
				   </c:forEach>
				</select>

								</div>
							</div>
							<div class="col-sm-3">
								<div class="input-textgroup col-sm-12">
									<span class="input-group-text"> 异常类型： </span>
									<select  name="_exceptionType"  id="_exceptionType" value="${param._exceptionType}"  class="form-control">
					<option value="" <c:if test="${param._exceptionType eq ''}">selected=selected</c:if> ></option>
				    <option value="cancel" <c:if test="${param._exceptionType eq 'cancel'}">selected=selected</c:if> >取消单</option>
				    <option value="refuse" <c:if test="${param._exceptionType eq 'refuse'}">selected=selected</c:if> >拒收单</option>
				    <option value="change" <c:if test="${param._exceptionType eq 'change'}">selected=selected</c:if> >换货单</option>
				    <option value="outScope" <c:if test="${param._exceptionType eq 'outScope'}">selected=selected</c:if> >超区单</option>
				    <option value="lose" <c:if test="${param._exceptionType eq 'lose'}">selected=selected</c:if> >丢件单</option>
				</select>

								</div>
							</div>
								<div class="col-sm-3">
								<div class="input-textgroup col-sm-12">
									<span class="input-group-text"> 订单号/快递单号： </span> 
									<input type="text" id="_allOrderno" name="_allOrderno"  class="form-control" value="${param._allOrderno}"/>
								</div>
							</div>
						</div>

                    <div class="form-group row">
						
							<div class="col-sm-3">
								<div class="input-textgroup col-sm-12">
									<span class="input-group-text"> 登记时间： </span> 
									<input type="text" name="_fromDate" id="_fromDate"  class="form-control" value="${param._fromDate}" />
								</div>
							</div>
							<div class="col-sm-3">
								<div class="input-textgroup col-sm-12">
									<span class="input-group-text"> 至： </span> 
									<input type="text" name="_toDate" id="_toDate" class="form-control" value="${param._toDate}"/> 
								</div>
							</div>
							</div>
							
							<div class="form-group row">
							 <div class="col-sm-12">
				                <button type="button" class="btn btn-info " style=" margin-right: 10px;" onclick="load()">搜索</button>
								<button type="button" id="btn_createBill" class="btn btn-warning" onclick="createInBill();" >批量入库</button>
			    <a href="${ctx}/v2/backOrder/toBackOrderPage/refuse" role="button"  class="btn btn-primary" >拒收单</a>
			    <a href="${ctx}/v2/backOrder/toBackOrderPage/change" role="button"  class="btn btn-primary" >换货单</a>
			    <a href="${ctx}/v2/backOrder/toBackOrderPage/outScope" role="button"  class="btn btn-primary" >超区单</a>
			    <a href="${ctx}/v2/backOrder/toBackOrderPage/lose" role="button"  class="btn btn-primary" >丢件单</a>
			    <a href="${ctx}/cancelOrder/v2_toCancelOrderPage" role="button"  class="btn btn-primary" >取消单</a>
			    <a role="button"  onclick="cancelExcel()" class="btn btn-info" >导出异常单Excel</a>
								</div>
							</div>
							
	 </form>
	</div>
	</div>
	</div>
	</div>

	<div class="row">
		<div class="col-md-12">

			<!-- Primary box -->
			<div class="box box-solid box-primary">
				<div class="box-header">
					<i class="fa fa-list"></i>
					<h3 class="box-title">查询结果</h3>
					<div class="box-tools pull-right">
						<button class="btn btn-primary btn-sm" data-widget="collapse">
							<i class="fa fa-minus"></i>
						</button>
					</div>
				</div>
				<div class="box-body">	
	<table id="contentTable" class="table table-striped table-condensed"><!-- remove class 'table-bordered' ,bug:300 , 20160623 -->
		<thead><tr>
				<th>
			       <input type="checkbox" id="chk_myCheckedAll" onclick="myCheckedAll();" />
			    </th>
			    <th>序号</th>
			    <th>商家</th>
			    <th>作业仓库</th>
			    <th>能容订单号</th>
			    <th>快递单号</th>
			    <th>来源店铺</th>
			    <th>来源单号</th>
			    <th>登记人</th>
			    <th>登记时间</th>
			    <th>类型</th>
			    <th>重发操作</th>
			    <th>退回操作</th>
			    <th>拦截标识</th>
			</tr></thead>
		<tbody>
		</tbody>
	</table>
	</div>
	</div>
	</div>
	</div>
	</section>
</body>
</html>
